#随机生成四个8位的验证码
import numpy as np

Num = np.array(list('0123456789'))
Upp = np.array(list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'))
Low = np.array(list('abcdefghijklmnopqrstuvwxyz'))
Str = np.array(list('#@&*^~$!%_-?><'))
A = [Num, Upp, Low, Str]
ret = np.array([])
for arr in A:
    ret = np.append(ret, arr)
#print(ret)

print("随机生成四个8位的验证码是：")
sz = 0
arr2 = []
for i in range (4):
    sz = len(ret)
    ret2 = []
    arr_rand = np.random.randint(0, sz, 8)
    for j in arr_rand:
        ret2.append(ret[j])
    arr2.append(ret2)
for k in arr2:
    #print(k)
    print(''.join(k))